/*
 * ComboBoxTableCellRenderer.java
 *
 * Created on 22 juni 2007, 9:51
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package net.jwtools.tmt.ui.propertyeditor;

import java.awt.Component;
import java.text.SimpleDateFormat;
import java.util.Date;

import javax.swing.JLabel;
import javax.swing.JTable;
import javax.swing.table.TableCellRenderer;

/**
 * 
 * @author mesui00
 */
public class DateTableCellRenderer extends JLabel implements
		TableCellRenderer {

	/** Creates a new instance of ATKDateTableCellRenderer */
	public DateTableCellRenderer() {
	}

	public Component getTableCellRendererComponent(JTable table, Object value,
			boolean isSelected, boolean hasFocus, int row, int column) {
		System.err.println(value);
		if (value != null) {
			setText(new SimpleDateFormat("dd-MM-yyyy").format((Date) value));
		}
		else setText("");
		return this;
	}

}
